
import React from 'react';  
import { useAtom } from 'jotai';  
import { countAtom } from './atoms'; // 确保路径正确  

const App: React.FC = () => { // 这里声明组件类型为 React.FC  
    const [count1, setCount1] = useAtom(countAtom); // useAtom 返回的类型已被 TypeScript 获取  

    return (  
        <div>  
            <h1>Count: {count1}</h1>  
            <button onClick={() => setCount1(count1 + 2)}>Increment</button>  
        </div>  
    );  
};  

export default App;  